﻿@using EasyMvc.Config
@{
    var adminMenu = ViewData["AdminMenu"] as AdminMenu;
    var userContext = ViewData["UserContext"] as EasyMvc.Web.Common.UserContext;    
    var userViewPermissions = userContext.Permission.ViewPermissions.Select(vp=>vp.ToString()).ToList();
}
<div class="head" id="header">
    <div class="logo">
        <img src="@Url.Content("~/Static/images/logo.png")" width="158"  alt="途家斯维登酒店管理系统" />
    </div>
    <div class="menu">
        <ul>
                @foreach (var group in adminMenu.AdminMenuGroups)
                {
                     foreach (var menu in group.AdminMenuItems)
                     {
                           <li>
                                <a href="@menu.Url" class="@(string.IsNullOrEmpty(menu.Permission) || !userViewPermissions.Contains(menu.Permission) ? "disabled" : "none")">@menu.Name</a>
                            </li>
                     }
                }
        </ul>
    </div>
    <div class="text">
        <p>
            <span style="color:green">欢迎您 @userContext.User.Username</span>
            角色
            [@string.Join(" ", userContext.Roles.Select(r=>r.Description))]
        </p>
        <p>
            <strong class="user">@Html.ActionLink("退出系统", "LogOut", "User", new { @class="logout"})</strong>
            <a href="@Url.Action("ModifyPwd", "User")?TB_iframe=true&KeepThis=true&height=150&width=280" class="thickbox pwd">修改密码</a>
            <a href="/" target="_blank" class="home">返回首页</a>
         </p>
    </div>
    
</div>